\hypertarget{group____newton}{
\subsection{Metodo de Newton-Rhapson}
\label{group____newton}\index{Metodo de Newton-Rhapson@{Metodo de Newton-Rhapson}}
}
\subsubsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapson}
\begin{CompactList}\small\item\em Estrutura de dados para o Metodo de Newton-Rhapson. \item\end{CompactList}\end{CompactItemize}
\subsubsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{group____newton_g4378a473f5c51c7d0e3ad25c0cea3791}{NEWTON\_\-DEFAULT\_\-MAX\_\-ITERATIONS}~100
\item 
\#define \hyperlink{group____newton_gb4bcb10de94d9bd68c583377bd506975}{NEWTON\_\-DEFAULT\_\-TOLERANCE}~1e-7
\end{CompactItemize}
\subsubsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef struct \hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapson} \hyperlink{group____newton_gf707b2eac68bcf9d277d812da5ac380a}{RootFindingNewtonRhapsonT}
\begin{CompactList}\small\item\em Apelido para struct \hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapson}. \item\end{CompactList}\end{CompactItemize}
\subsubsection*{Functions}
\begin{CompactItemize}
\item 
\hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapsonT} $\ast$ \hyperlink{group____newton_ga2ec468a98e05720903ac94228426bed}{RootFindingNewtonRhapsonCreate} (\hyperlink{structRootFindingBase}{RootFindingBaseT} $\ast$rootsObj)
\begin{CompactList}\small\item\em Cria um objeto do tipo struct \hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapson}. \item\end{CompactList}\item 
\hyperlink{RootFindingCommon_8h_31228d356f5429fa5ba7f206e4dee12f}{RootFindingBoolT} \hyperlink{group____newton_g3e1d44e30555a4b12ac1a0c56a75ba5e}{RootFindingNewtonRhapsonInit} (\hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapsonT} $\ast$newtonObj)
\begin{CompactList}\small\item\em Inicializa o objeto \hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapson}. \item\end{CompactList}\item 
void \hyperlink{group____newton_g40efb00500a3157208d224b3942ec915}{RootFindingNewtonRhapsonDelete} (\hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapsonT} $\ast$newtonObj)
\begin{CompactList}\small\item\em Apaga o objeto \hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapson}. \item\end{CompactList}\item 
\hyperlink{RootFindingCommon_8h_31228d356f5429fa5ba7f206e4dee12f}{RootFindingBoolT} \hyperlink{group____newton_g730f69beaf24e0c2ecfa81a124a09987}{RootFindingNewtonRhapsonPerformIteration} (\hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapsonT} $\ast$newtonObj)
\begin{CompactList}\small\item\em Realiza a iteracao. \item\end{CompactList}\item 
int \hyperlink{group____newton_ga8599365ab3f0770158719cdd32eb5c3}{RootFindingNewtonRhapsonGetErrorCode} (\hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapsonT} $\ast$newtonObj)
\begin{CompactList}\small\item\em Obtem o codigo de erro. \item\end{CompactList}\item 
int \hyperlink{group____newton_g9d87a4beccc7b61365f6b680fc1a4355}{RootFindingNewtonRhapsonGetStateCode} (\hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapsonT} $\ast$newtonObj)
\begin{CompactList}\small\item\em Obtem o codigo referente ao estado do objeto. \item\end{CompactList}\item 
const char $\ast$ \hyperlink{group____newton_gcbbd94963ebd3ddbaf6bf4e9ce1c0a1f}{RootFindingNewtonRhapsonGetErrorMessage} (\hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapsonT} $\ast$newtonObj)
\begin{CompactList}\small\item\em Obtem a mensagem de erro. \item\end{CompactList}\item 
const char $\ast$ \hyperlink{group____newton_g70436f650ac07866bb8d9897908f4422}{RootFindingNewtonRhapsonGetStateMessage} (\hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapsonT} $\ast$newtonObj)
\begin{CompactList}\small\item\em Obtem a mensagem referente ao estado do objeto. \item\end{CompactList}\item 
\hyperlink{RootFindingCommon_8h_31228d356f5429fa5ba7f206e4dee12f}{RootFindingBoolT} \hyperlink{group____newton_g6d26d28c2bf14b9bf4072c6ccd70269f}{RootFindingNewtonRhapsonHasError} (\hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapsonT} $\ast$newtonObj)
\begin{CompactList}\small\item\em Verifica se ha erros. \item\end{CompactList}\item 
static void \hyperlink{group____newton_g5d327a5dbdddddf1f6f5a68e7089031b}{setError} (\hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapsonT} $\ast$newtonObj, int errorCode)
\begin{CompactList}\small\item\em Set error code and change state to NEWTON\_\-ERROR\_\-FOUND. \item\end{CompactList}\item 
static void \hyperlink{group____newton_g3ebdf784fb05eaa2cc11fee2f1eef503}{resetError} (\hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapsonT} $\ast$newtonObj)
\item 
static \hyperlink{RootFindingCommon_8h_a296fe63994e03408c4ad62794d472e9}{RootFindingDoubleT} \hyperlink{group____newton_gf3686b9647cf53686b267e45dc9ecd1e}{getNextX} (\hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapsonT} $\ast$newtonObj)
\begin{CompactList}\small\item\em Obtem o valor para o proximo x. \item\end{CompactList}\end{CompactItemize}


\subsubsection{Define Documentation}
\hypertarget{group____newton_g4378a473f5c51c7d0e3ad25c0cea3791}{
\index{\_\-newton@{\_\-newton}!NEWTON\_\-DEFAULT\_\-MAX\_\-ITERATIONS@{NEWTON\_\-DEFAULT\_\-MAX\_\-ITERATIONS}}
\index{NEWTON\_\-DEFAULT\_\-MAX\_\-ITERATIONS@{NEWTON\_\-DEFAULT\_\-MAX\_\-ITERATIONS}!_newton@{\_\-newton}}
\paragraph[NEWTON\_\-DEFAULT\_\-MAX\_\-ITERATIONS]{\setlength{\rightskip}{0pt plus 5cm}\#define NEWTON\_\-DEFAULT\_\-MAX\_\-ITERATIONS~100}\hfill}
\label{group____newton_g4378a473f5c51c7d0e3ad25c0cea3791}




Definition at line 38 of file RootFindingNewtonRhapson.h.

Referenced by RootFindingNewtonRhapsonCreate().\hypertarget{group____newton_gb4bcb10de94d9bd68c583377bd506975}{
\index{\_\-newton@{\_\-newton}!NEWTON\_\-DEFAULT\_\-TOLERANCE@{NEWTON\_\-DEFAULT\_\-TOLERANCE}}
\index{NEWTON\_\-DEFAULT\_\-TOLERANCE@{NEWTON\_\-DEFAULT\_\-TOLERANCE}!_newton@{\_\-newton}}
\paragraph[NEWTON\_\-DEFAULT\_\-TOLERANCE]{\setlength{\rightskip}{0pt plus 5cm}\#define NEWTON\_\-DEFAULT\_\-TOLERANCE~1e-7}\hfill}
\label{group____newton_gb4bcb10de94d9bd68c583377bd506975}




Definition at line 39 of file RootFindingNewtonRhapson.h.

Referenced by RootFindingNewtonRhapsonCreate().

\subsubsection{Typedef Documentation}
\hypertarget{group____newton_gf707b2eac68bcf9d277d812da5ac380a}{
\index{\_\-newton@{\_\-newton}!RootFindingNewtonRhapsonT@{RootFindingNewtonRhapsonT}}
\index{RootFindingNewtonRhapsonT@{RootFindingNewtonRhapsonT}!_newton@{\_\-newton}}
\paragraph[RootFindingNewtonRhapsonT]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf RootFindingNewtonRhapson} {\bf RootFindingNewtonRhapsonT}}\hfill}
\label{group____newton_gf707b2eac68bcf9d277d812da5ac380a}


Apelido para struct \hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapson}. 



Definition at line 87 of file RootFindingNewtonRhapson.h.

\subsubsection{Function Documentation}
\hypertarget{group____newton_gf3686b9647cf53686b267e45dc9ecd1e}{
\index{\_\-newton@{\_\-newton}!getNextX@{getNextX}}
\index{getNextX@{getNextX}!_newton@{\_\-newton}}
\paragraph[getNextX]{\setlength{\rightskip}{0pt plus 5cm}static {\bf RootFindingDoubleT} getNextX ({\bf RootFindingNewtonRhapsonT} $\ast$ {\em newtonObj})\hspace{0.3cm}{\tt  \mbox{[}static, private\mbox{]}}}\hfill}
\label{group____newton_gf3686b9647cf53686b267e45dc9ecd1e}


Obtem o valor para o proximo x. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em newtonObj}]Ponteiro para objeto struct \hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapson} \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Valor do proximo x \end{Desc}


Definition at line 127 of file RootFindingNewtonRhapson.c.

References RootFindingBase::fX, RootFindingBaseDiffEval(), RootFindingNewtonRhapson::rootsObj, and RootFindingBase::x.\hypertarget{group____newton_g3ebdf784fb05eaa2cc11fee2f1eef503}{
\index{\_\-newton@{\_\-newton}!resetError@{resetError}}
\index{resetError@{resetError}!_newton@{\_\-newton}}
\paragraph[resetError]{\setlength{\rightskip}{0pt plus 5cm}static void resetError ({\bf RootFindingNewtonRhapsonT} $\ast$ {\em newtonObj})\hspace{0.3cm}{\tt  \mbox{[}static, private\mbox{]}}}\hfill}
\label{group____newton_g3ebdf784fb05eaa2cc11fee2f1eef503}




Definition at line 195 of file RootFindingNewtonRhapson.c.

References RootFindingNewtonRhapson::errorCode, and RootFindingNewtonRhapson::state.\hypertarget{group____newton_ga2ec468a98e05720903ac94228426bed}{
\index{\_\-newton@{\_\-newton}!RootFindingNewtonRhapsonCreate@{RootFindingNewtonRhapsonCreate}}
\index{RootFindingNewtonRhapsonCreate@{RootFindingNewtonRhapsonCreate}!_newton@{\_\-newton}}
\paragraph[RootFindingNewtonRhapsonCreate]{\setlength{\rightskip}{0pt plus 5cm}{\bf RootFindingNewtonRhapsonT}$\ast$ RootFindingNewtonRhapsonCreate ({\bf RootFindingBaseT} $\ast$ {\em rootsObj})}\hfill}
\label{group____newton_ga2ec468a98e05720903ac94228426bed}


Cria um objeto do tipo struct \hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapson}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rootsObj}]Ponteiro para objeto do tipo struct \hyperlink{structRootFindingBase}{RootFindingBase} \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Ponteiro para o objeto criado \end{Desc}


Definition at line 47 of file RootFindingNewtonRhapson.c.

References RootFindingNewtonRhapson::maxIterations, NEWTON\_\-DEFAULT\_\-MAX\_\-ITERATIONS, NEWTON\_\-DEFAULT\_\-TOLERANCE, resetError(), RootFindingNewtonRhapson::rootsObj, RootFindingNewtonRhapson::state, and RootFindingNewtonRhapson::tolerance.\hypertarget{group____newton_g40efb00500a3157208d224b3942ec915}{
\index{\_\-newton@{\_\-newton}!RootFindingNewtonRhapsonDelete@{RootFindingNewtonRhapsonDelete}}
\index{RootFindingNewtonRhapsonDelete@{RootFindingNewtonRhapsonDelete}!_newton@{\_\-newton}}
\paragraph[RootFindingNewtonRhapsonDelete]{\setlength{\rightskip}{0pt plus 5cm}void RootFindingNewtonRhapsonDelete ({\bf RootFindingNewtonRhapsonT} $\ast$ {\em newtonObj})}\hfill}
\label{group____newton_g40efb00500a3157208d224b3942ec915}


Apaga o objeto \hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapson}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em newtonObj}]Ponteiro para o objeto \end{description}
\end{Desc}


Definition at line 115 of file RootFindingNewtonRhapson.c.\hypertarget{group____newton_ga8599365ab3f0770158719cdd32eb5c3}{
\index{\_\-newton@{\_\-newton}!RootFindingNewtonRhapsonGetErrorCode@{RootFindingNewtonRhapsonGetErrorCode}}
\index{RootFindingNewtonRhapsonGetErrorCode@{RootFindingNewtonRhapsonGetErrorCode}!_newton@{\_\-newton}}
\paragraph[RootFindingNewtonRhapsonGetErrorCode]{\setlength{\rightskip}{0pt plus 5cm}int RootFindingNewtonRhapsonGetErrorCode ({\bf RootFindingNewtonRhapsonT} $\ast$ {\em newtonObj})}\hfill}
\label{group____newton_ga8599365ab3f0770158719cdd32eb5c3}


Obtem o codigo de erro. 



Definition at line 190 of file RootFindingNewtonRhapson.c.

References RootFindingNewtonRhapson::errorCode.\hypertarget{group____newton_gcbbd94963ebd3ddbaf6bf4e9ce1c0a1f}{
\index{\_\-newton@{\_\-newton}!RootFindingNewtonRhapsonGetErrorMessage@{RootFindingNewtonRhapsonGetErrorMessage}}
\index{RootFindingNewtonRhapsonGetErrorMessage@{RootFindingNewtonRhapsonGetErrorMessage}!_newton@{\_\-newton}}
\paragraph[RootFindingNewtonRhapsonGetErrorMessage]{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ RootFindingNewtonRhapsonGetErrorMessage ({\bf RootFindingNewtonRhapsonT} $\ast$ {\em newtonObj})}\hfill}
\label{group____newton_gcbbd94963ebd3ddbaf6bf4e9ce1c0a1f}


Obtem a mensagem de erro. 



Definition at line 211 of file RootFindingNewtonRhapson.c.

References RootFindingBase::a, RootFindingBase::b, RootFindingBase::e, RootFindingNewtonRhapson::errorCode, msg, MSG\_\-NEWTON\_\-2NDIFF\_\-TEST\_\-ERROR, MSG\_\-NEWTON\_\-2NDIFFA\_\-2NDIFFB\_\-SIGN\_\-NOT\_\-EQUALS\_\-ERROR, MSG\_\-NEWTON\_\-NO\_\-ERROR, MSG\_\-NEWTON\_\-X\_\-ISINF\_\-OR\_\-ISNAN\_\-ERROR, MSG\_\-ROOTS\_\-UNKNOW\_\-ERROR, RootFindingNewtonRhapson::rootsObj, and RootFindingBase::x.\hypertarget{group____newton_g9d87a4beccc7b61365f6b680fc1a4355}{
\index{\_\-newton@{\_\-newton}!RootFindingNewtonRhapsonGetStateCode@{RootFindingNewtonRhapsonGetStateCode}}
\index{RootFindingNewtonRhapsonGetStateCode@{RootFindingNewtonRhapsonGetStateCode}!_newton@{\_\-newton}}
\paragraph[RootFindingNewtonRhapsonGetStateCode]{\setlength{\rightskip}{0pt plus 5cm}int RootFindingNewtonRhapsonGetStateCode ({\bf RootFindingNewtonRhapsonT} $\ast$ {\em newtonObj})}\hfill}
\label{group____newton_g9d87a4beccc7b61365f6b680fc1a4355}


Obtem o codigo referente ao estado do objeto. 



Definition at line 204 of file RootFindingNewtonRhapson.c.

References RootFindingNewtonRhapson::state.\hypertarget{group____newton_g70436f650ac07866bb8d9897908f4422}{
\index{\_\-newton@{\_\-newton}!RootFindingNewtonRhapsonGetStateMessage@{RootFindingNewtonRhapsonGetStateMessage}}
\index{RootFindingNewtonRhapsonGetStateMessage@{RootFindingNewtonRhapsonGetStateMessage}!_newton@{\_\-newton}}
\paragraph[RootFindingNewtonRhapsonGetStateMessage]{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ RootFindingNewtonRhapsonGetStateMessage ({\bf RootFindingNewtonRhapsonT} $\ast$ {\em newtonObj})}\hfill}
\label{group____newton_g70436f650ac07866bb8d9897908f4422}


Obtem a mensagem referente ao estado do objeto. 



Definition at line 235 of file RootFindingNewtonRhapson.c.

References RootFindingBase::e, RootFindingNewtonRhapson::maxIterations, msg, MSG\_\-NEWTON\_\-APPROXIMANTION\_\-ROOT\_\-FOUND, MSG\_\-NEWTON\_\-ERROR\_\-FOUND, MSG\_\-NEWTON\_\-INITIALIZED, MSG\_\-NEWTON\_\-MAX\_\-ITERATIONS\_\-LIMIT\_\-REACHED, MSG\_\-NEWTON\_\-NOT\_\-INIT, MSG\_\-ROOTS\_\-UNKNOW\_\-STATE, RootFindingNewtonRhapson::rootsObj, RootFindingNewtonRhapson::state, RootFindingNewtonRhapson::tolerance, and RootFindingBase::x.\hypertarget{group____newton_g6d26d28c2bf14b9bf4072c6ccd70269f}{
\index{\_\-newton@{\_\-newton}!RootFindingNewtonRhapsonHasError@{RootFindingNewtonRhapsonHasError}}
\index{RootFindingNewtonRhapsonHasError@{RootFindingNewtonRhapsonHasError}!_newton@{\_\-newton}}
\paragraph[RootFindingNewtonRhapsonHasError]{\setlength{\rightskip}{0pt plus 5cm}{\bf RootFindingBoolT} RootFindingNewtonRhapsonHasError ({\bf RootFindingNewtonRhapsonT} $\ast$ {\em newtonObj})}\hfill}
\label{group____newton_g6d26d28c2bf14b9bf4072c6ccd70269f}


Verifica se ha erros. 

\begin{Desc}
\item[Returns:]TRUE caso haja erro \end{Desc}


Definition at line 260 of file RootFindingNewtonRhapson.c.

References RootFindingNewtonRhapson::errorCode.\hypertarget{group____newton_g3e1d44e30555a4b12ac1a0c56a75ba5e}{
\index{\_\-newton@{\_\-newton}!RootFindingNewtonRhapsonInit@{RootFindingNewtonRhapsonInit}}
\index{RootFindingNewtonRhapsonInit@{RootFindingNewtonRhapsonInit}!_newton@{\_\-newton}}
\paragraph[RootFindingNewtonRhapsonInit]{\setlength{\rightskip}{0pt plus 5cm}{\bf RootFindingBoolT} RootFindingNewtonRhapsonInit ({\bf RootFindingNewtonRhapsonT} $\ast$ {\em newtonObj})}\hfill}
\label{group____newton_g3e1d44e30555a4b12ac1a0c56a75ba5e}


Inicializa o objeto \hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapson}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em newtonObj}]Ponteiro para o objeto a ser inicializado \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]TRUE em caso de sucesso, FALSE caso contrario \end{Desc}


Definition at line 65 of file RootFindingNewtonRhapson.c.

References RootFindingBase::a, RootFindingBase::b, RootFindingBase::e, FALSE, RootFindingBase::fX, RootFindingNewtonRhapson::i, infinity(), RootFindingBase2nDiffEval(), RootFindingBaseEval(), RootFindingNewtonRhapson::rootsObj, setError(), RootFindingNewtonRhapson::state, TRUE, and RootFindingBase::x.\hypertarget{group____newton_g730f69beaf24e0c2ecfa81a124a09987}{
\index{\_\-newton@{\_\-newton}!RootFindingNewtonRhapsonPerformIteration@{RootFindingNewtonRhapsonPerformIteration}}
\index{RootFindingNewtonRhapsonPerformIteration@{RootFindingNewtonRhapsonPerformIteration}!_newton@{\_\-newton}}
\paragraph[RootFindingNewtonRhapsonPerformIteration]{\setlength{\rightskip}{0pt plus 5cm}{\bf RootFindingBoolT} RootFindingNewtonRhapsonPerformIteration ({\bf RootFindingNewtonRhapsonT} $\ast$ {\em newtonObj})}\hfill}
\label{group____newton_g730f69beaf24e0c2ecfa81a124a09987}


Realiza a iteracao. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em newtonObj}]Ponteiro para o objeto \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]TRUE caso haja mais iteracoes a serem realizadas \end{Desc}


Definition at line 146 of file RootFindingNewtonRhapson.c.

References RootFindingBase::e, FALSE, RootFindingBase::fX, getNextX(), RootFindingNewtonRhapson::i, isInfOrNan(), RootFindingNewtonRhapson::maxIterations, RootFindingBaseEval(), RootFindingNewtonRhapson::rootsObj, setError(), RootFindingNewtonRhapson::state, RootFindingBase::state, RootFindingNewtonRhapson::tolerance, TRUE, and RootFindingBase::x.\hypertarget{group____newton_g5d327a5dbdddddf1f6f5a68e7089031b}{
\index{\_\-newton@{\_\-newton}!setError@{setError}}
\index{setError@{setError}!_newton@{\_\-newton}}
\paragraph[setError]{\setlength{\rightskip}{0pt plus 5cm}static void setError ({\bf RootFindingNewtonRhapsonT} $\ast$ {\em newtonObj}, \/  int {\em errorCode})\hspace{0.3cm}{\tt  \mbox{[}static, private\mbox{]}}}\hfill}
\label{group____newton_g5d327a5dbdddddf1f6f5a68e7089031b}


Set error code and change state to NEWTON\_\-ERROR\_\-FOUND. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em newtonObj}]Ponteiro para objeto \hyperlink{structRootFindingNewtonRhapson}{RootFindingNewtonRhapson} \item[{\em errorCode}]Codigo de erro \end{description}
\end{Desc}


Definition at line 140 of file RootFindingNewtonRhapson.c.

References RootFindingNewtonRhapson::errorCode, and RootFindingNewtonRhapson::state.